import { createRouter, createWebHistory } from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import personalPage from "@/views/personalPage/PersonalPage.vue";

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {path:'/home',component: () => import('../views/HomeView.vue')},
  {
    path: '/personal',
    component: personalPage,
    redirect:'/article',
    children:[
      {path:'/article',component: () => import('../views/personalPage/ArticlePage.vue')},
      {path:'/replied',component: () => import('../views/personalPage/RepliedPage.vue')},
      {path:'/question',component: () => import('../views/personalPage/QuestionPage.vue')},
      {path:'/likeArticle',component: () => import('../views/personalPage/LikeArticlePage.vue')},
      {path:'/favorites',component: () => import('../views/personalPage/FavoritesPage.vue')},
      {path:'/draft',component: () => import('../views/personalPage/DraftPage.vue')},
    ]
  },
  {path: '/login', component: () => import('../views/LoginView.vue')},
  {path: '/text01', component: () => import('../views/personalPage/text_01.vue')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
